package com.jifujun.fastdfs_springboot.util;

import java.io.File;

/**
 * Create with IntelliJ IDEA
 * Project Name: fast_dfs
 * Package Name: com.jifujun.fast_dfs.util
 * Date: 2018/3/2714:07
 * User: 快乐的小菌菌
 * Description:
 */
public class StringUtil {
    public static String stitchUploadPath(String[] strings) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < strings.length; i++) {
            if (i == strings.length - 1) {
                stringBuilder.append(strings[i]);
            } else {
                stringBuilder.append(strings[i]).append("/");
            }
        }
        return stringBuilder.toString();
    }

    public static String deleteDot(String extName) {
        return extName.substring(extName.lastIndexOf(".") + 1);
    }

    public static String deleteSlash(String arg) {
        return arg.substring(arg.lastIndexOf("/"));
    }
}
